package com.xiaoyu.test.common;

import com.xiaoyu.beans.BeansException;
import com.xiaoyu.beans.PropertyValue;
import com.xiaoyu.beans.PropertyValues;
import com.xiaoyu.beans.factory.ConfigurableListableBeanFactory;
import com.xiaoyu.beans.factory.config.BeanDefinition;
import com.xiaoyu.beans.factory.config.BeanFactoryPostProcessor;

public class CustomBeanFactoryPostProcessor implements BeanFactoryPostProcessor {
    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        BeanDefinition personBeanDefinition = beanFactory.getBeanDefinition("person");
        PropertyValues propertyValues = personBeanDefinition.getPropertyValues();
        propertyValues.addPropertyValue(new PropertyValue("name", "have"));
    }
}
